<?php

class ControllerAction__Helper_ViewRenderer extends Zend_Controller_Action_Helper_ViewRenderer {
	
	public function init(){
		parent::init();
		$config = Zend_Registry::get ( 'config' );		
		$this->setViewSuffix($config->view->suffix);
		//初始化视图类（增加新的视图路径；设定视图帮助目录）
		//增加共享视图
		if(!empty($config->view->shareview)){
			$_shareviewPath = trim($config->view->shareview);			
			$this->view->addScriptPath(APP_DIR.DIRECTORY_SEPARATOR.$_shareviewPath);			
		}
		//增加共享视图助手
		$_viewHelperPrefix = trim($config->view->viewHelperPrefix);
		$_shareviewPath = empty($_viewHelperPrefix)?'ViewHelper':$_viewHelperPrefix;
		$this->view->addHelperPath(MODELS_MVC_DIR.DIRECTORY_SEPARATOR.$_viewHelperPrefix, $_viewHelperPrefix);
			
	}
}